import request from '@/utils/request'

export const getDepartmentApi = () => {
  return request({
    // 默认请求方式是get
    url: '/company/department'
  })
}

export const getManagerListApi = () => {
  return request.get('/sys/user/simple')
}

/**
 * 新增组织
 * ***/
export const addDepartmentApi = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

/**
 * 部门详情
 */
export const getDepartmentDetailApi = (id) => {
  return request.get(`/company/department/${id}`)
}

/** *
 * 更新部门
 * ***/
export const updateDepartmentApi = (data) => {
  return request.put(`/company/department/${data.id}`, data)
}

/**
 * 删除部门
 *
*/

export const delDepartmentApi = (id) => {
  return request.delete(`/company/department/${id}`)
}

